package com.example.administrator.testpersionn;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.widget.ListView;

import com.example.administrator.out1.TabarColorActivity;
import com.example.administrator.out1.adapter.ListAdapter;
import com.example.administrator.out1.bena.ListBean;
import com.example.administrator.out1.callback.ShopItemCallBack;
import com.example.administrator.out1.utlis.ActivityUtils;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

public class ListItemPopActivity extends AppCompatActivity {
    ListView listView;
    List<ListBean> listBeans=new ArrayList<>();
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_list_item_pop);
        listView=findViewById(R.id.listview);
        for (int i = 0; i < 4; i++) {
            ListBean listBean=new ListBean("列表"+i, Arrays.asList(new String[]{"嘚瑟","嘚瑟","嘚瑟"}));
            listBeans.add(listBean);

        }
        ListAdapter listAdapter = new ListAdapter(listBeans, this);

        listView.setAdapter(listAdapter);

        listAdapter.setOnitem(new ShopItemCallBack() {
            @Override
            public void item(String id) {
                Log.d("=====", "item: "+id);

                ActivityUtils.initActivity(com.example.administrator.out1.ListItemPopActivity.this).
                        putExtra("text","我是测试页面").
                        startActivity(TabarColorActivity.class);


            }
        });

    }
}
